package org.jz.gae.redbook.spb.server.controller;

import org.jz.gae.redbook.spb.server.cache.DistrictCashe;
import org.jz.gae.redbook.spb.shared.DistrictEntityView;

import com.google.appengine.api.datastore.Entity;

public class DistrictCasheGoogle extends AbstractCasheGoogle<DistrictEntityView> implements DistrictCashe
{
	private static DistrictCashe instance;
	
	public synchronized static DistrictCashe getInstance()
	{
		if (instance == null)
		{
			instance = new DistrictCasheGoogle();
		}
		return instance;
	}
	
	@Override
	public synchronized DistrictEntityView getEntityView(String _LocationKey)
	{
		return getEntityViewInternal(_LocationKey);
	}

	@Override
	protected DistrictEntityView produceViewFormEntity(Entity _Entity)
	{
		DistrictEntityView result = new DistrictEntityView();
        DistrictUtils.reflectEntityToView(_Entity, result);
		return result;
	}

}
